<!-- 页面头部 -->
<header class="main-header">


    <!-- Logo -->
    <a href="all-admin-index.html" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>房屋</b></span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>房屋</b>中介管理</span>
    </a>


    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>

        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <!-- Messages: style can be found in dropdown.less-->
                <!--                <li class="dropdown messages-menu">-->
                <!--                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">-->
                <!--                        <i class="fa fa-envelope-o"></i>-->
                <!--                        <span class="label label-success">4</span>-->
                <!--                    </a>-->

                <!--                </li>-->
                <!--                &lt;!&ndash; Notifications: style can be found in dropdown.less &ndash;&gt;-->
                <!--                <li class="dropdown notifications-menu">-->
                <!--                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">-->
                <!--                        <i class="fa fa-bell-o"></i>-->
                <!--                        <span class="label label-warning">10</span>-->
                <!--                    </a>-->

                <!--                </li>-->
                <!--                &lt;!&ndash; Tasks: style can be found in dropdown.less &ndash;&gt;-->
                <!--                <li class="dropdown tasks-menu">-->
                <!--                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">-->
                <!--                        <i class="fa fa-flag-o"></i>-->
                <!--                        <span class="label label-danger">9</span>-->
                <!--                    </a>-->

                <!--                </li>-->
                <!-- User Account: style can be found in dropdown.less -->
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <!--                        <img src="../img/avatar5.png" class="user-image" alt="User Image">-->
                        <img src="../img/user-head.png" id="userhead2" class="user-image" alt="User Image">
                        <span class="hidden-xs" id="default_name1">用户</span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">
                            <img src="../img/user-head.png" id="userhead3" class="img-circle" alt="User Image">
                            <p class="default_name" id="default_name2">
                                用户 - 数据管理
                                <small>欢迎登录</small>
                            </p>
                        </li>

                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                <a href="/pages/all-admin-password.html" class="btn btn-default btn-flat">修改密码</a>
                            </div>
                            <div class="pull-right">
                                <a href="/user/logout" class="btn btn-default btn-flat">注销</a>
                            </div>
                        </li>
                    </ul>
                </li>

            </ul>
        </div>
    </nav>
</header>
<!-- 页面头部 /-->

<!-- 导航侧栏 -->
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="../img/user-head.png" id="userhead1" class="img-circle" alt="User Image">
            </div>
            <div class="pull-left info">
                <p id="default_name3">用户</p>
                <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
            </div>
        </div>
        <!-- search form -->
        <!--<form action="#" method="get" class="sidebar-form">
    <div class="input-group">
        <input type="text" name="q" class="form-control" placeholder="搜索...">
        <span class="input-group-btn">
        <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
        </button>
      </span>
    </div>
</form>-->
        <!-- /.search form -->


        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li class="header">菜单</li>

            <li id="admin-index"><a href="all-admin-index.html">
                <i class="fa fa-dashboard"></i> <span>首页</span></a>
            </li>

            <!-- 菜单 -->
            <!-- 增，删，改，查  -->
            <!--  1.房屋所有（除去个人的房屋信息）信息，（带查询模块），（点击应该可以查看详细信息）-->
            <li class="treeview">
                <a href="#">
                    <i class="glyphicon glyphicon-home"></i> <span>开放房源</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="public-rent">
                        <a href="all-order-manage-list.html">
                            <i class="fa fa-circle-o"></i> 租用房屋
                        </a>
                    </li>

                    <li id="public-buy">
                        <a href="all-order-manage-buy.html">
                            <i class="fa fa-circle-o"></i> 购买房屋
                        </a>
                    </li>
                </ul>
            </li>

            <!--  2.管理我的房屋， （带查询模块）-->
            <li class="treeview">
                <a href="#">
                    <i class="glyphicon glyphicon-briefcase"></i> <span>我的房屋</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="admin-rent">
                        <a href="user-rent.html">
                            <i class="fa fa-circle-o"></i> 出租房屋
                        </a>
                    </li>

                    <li id="admin-buy">
                        <a href="user-buy.html">
                            <i class="fa fa-circle-o"></i> 售卖房屋
                        </a>
                    </li>

                    <li id="admin-create">
                        <a href="all-admin-create-house.html">
                            <i class="fa fa-circle-o"></i> 发布房源
                        </a>
                    </li>
                </ul>
            </li>
            <!--  3.个人信息管理-->
            <li class="treeview">
                <a href="#">
                    <i class="glyphicon glyphicon-user"></i> <span>个人信息</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="admin-information">
                        <a href="user-msg.html">
                            <i class="fa fa-circle-o"></i> 详细信息
                        </a>
                    </li>

                    <li id="admin-update">
                        <a href="user-update.html">
                            <i class="fa fa-circle-o"></i> 修改信息
                        </a>
                    </li>
                </ul>
            </li>

            <!-- 菜单 /-->

            <!--            <li id="admin-documentation"><a href="documentation.html" target="_blank"><i class="fa fa-book"></i>-->
            <!--                <span>AdminLTE汉化文档</span></a></li>-->

        </ul>
    </section>
    <!-- /.sidebar -->
</aside>


<script>
    $(function () {
        var userData = "";  //保存的是当前个人的基本信息
        //填充个人基本信息表格数据
        function handleuserData() {
            if (userData !== "") {
                if (userData.headImage != undefined && userData.headImage != "") {
                    $("#userhead1").attr("src", "../headImage/" + userData.headImage);
                    $("#userhead2").attr("src", "../headImage/" + userData.headImage);
                    $("#userhead3").attr("src", "../headImage/" + userData.headImage);
                }
                if (userData.userName != undefined && userData.userName != ""
                &&userData.userName != "匿名") {
                    $("#default_name1").text(userData.userName);
                    $("#default_name2").text(userData.userName);
                    $("#default_name3").text(userData.userName);

                }

            } else {
                alert("获取用户信息失败，请联系工作人员！")
            }


        }

        //获取当前用户的信息
        $.ajax({
            url: "/all-order-manage-edit/message/user",   //请求路径
            type: "get",    //请求方式
            dataType: "json",  //设置接收到数据类型
            success: function (data) {
                console.log("返回的用户信息:" + data);
                userData = JSON.parse(data);
                handleuserData();   //处理请求
                // 处理分页数据
            },    //成功
            error: function () {
                console.log("获取姓名失败...")
            }
        })


    })


</script>